# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=tracer
pkgver=0.7.8
pkgrel=3
pkgdesc="OTracer finds outdated running applications in your system"
arch=('any')
url="http://tracer-package.com/"
license=('GPL')
depends=(python python-distro python-psutil python-six dbus-python pyalpm)
makedepends=(python-setuptools)
checkdepends=(python-pytest)
source=("$pkgname-$pkgver.tar.gz::https://github.com/FrostyX/tracer/archive/refs/tags/$pkgname-$pkgver-1.tar.gz")
sha512sums=('d7ac83cd3a987688e78e2bbb6c0deffdecff5a77389bbf56ee63e08b0db989cffc24bfec183e9fae880ad022046bf3da38bc107a006a5e950069f707489cd8be')

prepare() {
    cd "$pkgname-$pkgname-$pkgver-1"
    cp LICENSE LICENCE.md
}

check() {
    cd "$pkgname-$pkgname-$pkgver-1"
    PYTHONPATH=. pytest tests
}

build() {
    cd "$pkgname-$pkgname-$pkgver-1"

    python setup.py build
}

package() {
    cd "$pkgname-$pkgname-$pkgver-1"

    python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
    install -Dm644 LICENCE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
